<%@ page import="java.util.List" %>
<%@ page import="com.alibaba.fastjson.JSON" %>
<%@ page import="com.qf.emp.entity.Dept" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <base href="<%=request.getContextPath()+"/"%>">
    <title>Title</title>
    <%--    <base href="/abc/">--%>
    <title>Title</title>

    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="bootstrap-3.4.1/dist/css/bootstrap.css">

    <script type="text/javascript" src="js/jquery.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="bootstrap-3.4.1/dist/js/bootstrap.js"></script>



</head>
<body>

<a href="dept/addDept.jsp" class="btn btn-info" role="button">
    <%--  glyphicon glyphicon-plus 代表Bootstrap的图标  --%>
    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
    添加</a>

<table class="table table-striped table-bordered table-condensed">
    <tr>
        <th>部门编号</th>
        <th>部门</th>
        <th>职位</th>
        <th>操作</th>
    </tr>

    <c:forEach items="${deptlist}" var="dept">
        <tr>
            <td>${dept.deptno}</td>
            <td>${dept.dname}</td>
            <td>${dept.loc}</td>
            <td>
                    <%--  Bootstrap的按钮btn  按钮为蓝色btn-primary --%>
                <a class="btn btn-primary btn-xs" role="button"
                   href="DeptServlet/getDeptById?deptno=${dept.deptno}">
                    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                    编辑</a>
                <a class="btn btn-danger btn-xs" role="button"
                   href="DeptServlet/removeDept?deptno=${dept.deptno}">
                    <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
                    删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
